﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using System.Globalization;

using SBPweb.Data.Generic;

namespace SBPweb.Data
{
	/// <summary>
    /// This exception is thrown when an unexpected error
    /// is received from the database.
    /// </summary>
    [Serializable]
    public class RepositoryFailureException : RepositoryException
    {

		/// <summary>
		/// Initializes a new RepositoryFailureException instance
		/// </summary>
        public RepositoryFailureException()
        {
        }

		/// <summary>
		/// Initializes a new RepositoryFailureException instance
		/// </summary>
		/// <param name="message">Message of exception</param>
		public RepositoryFailureException(string message)
            : base(message)
        {
        }

		/// <summary>
		/// Initializes a new RepositoryFailureException instance
		/// </summary>
		/// <param name="message">Message of exception</param>
		/// <param name="inner">InnerException of exception</param>
        public RepositoryFailureException(string message, Exception inner)
            : base(message, inner)
        {
        }

		/// <summary>
		/// Initializes a new RepositoryFailureException instance
		/// </summary>
		/// <param name="inner">InnerException of Exception</param>
        public RepositoryFailureException(Exception inner)
            : base(string.Format(CultureInfo.CurrentCulture, GenericResources.DefaultMessage), inner)
        {
        }

		/// <summary>
		/// Initializes a new RepositoryFailureException instance
		/// </summary>
		/// <param name="info">info parameter for serialization/deserialization</param>
		/// <param name="context">context parameter for serialization/deserialization</param>
		protected RepositoryFailureException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }
    }
}

